package com.example.demo.controller;

import bom.example.common.common.Results;
import com.alibaba.fastjson.JSONObject;
import com.example.demo.domain.User;
import com.example.demo.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author X.I.O
 * @title: UserController_2
 * @projectName spring-boot-luncene
 * @description: TODO
 * @date 2021/11/19 13:36
 */
@RestController
@RequestMapping("/user/test")
public class UserController_2 {

    private final UserService userService;

    @GetMapping("/test")
    public JSONObject getTestController(){
        List<User> users=this.userService.list();
        return Results.success(users);
    }


    public UserController_2(UserService userService) {
        this.userService = userService;
    }
}
